package cn.wizzer.app.sys.modules.models;

import cn.wizzer.framework.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;

import java.io.Serializable;
import java.math.BigDecimal;

@EqualsAndHashCode(callSuper = true)
@Table("sys_param")
@Data
public class SysParam extends BaseModel implements Serializable {
    private static final long serialVersionUID = 1L;

    @Column
    @Name
    @Comment("ID")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @PrevInsert(els = {@EL("uuid()")})
    private String id;

    @Column
    @Comment("跳过token验证")
    @Default("0")
    @ColDefine(type = ColType.BOOLEAN)
    private boolean debug;

    @Column
    @Comment("是否需要邀请码")
    @Default("0")
    @ColDefine(type = ColType.BOOLEAN)
    private boolean isNeedInviteCode;

    @Column
    @Comment("返佣有效层级")
    @Default("0")
    @ColDefine(type = ColType.INT, width = 3)
    private Integer rebateValidLayer;

    @Column
    @Comment("返佣比例单位;万")
    @ColDefine(type=ColType.INT, width=4)
    @Default("100")
    private Integer superRate;

    @Column
    @Comment("层级比例单位;百")
    @ColDefine(type=ColType.INT, width=2)
    @Default("10")
    private Integer levelRate;

    @Column
    @Comment("提现手续费单位;百")
    @ColDefine(type=ColType.FLOAT, width=4 ,precision = 2)
    @Default("10")
    private BigDecimal withdrawFee;

    @Column
    @Comment("用户登录有效时长")
    @ColDefine(type=ColType.INT, width=4)
    @Default("60")
    private Integer loginValidTime;

    @Column
    @Comment("客服聊天记录保留天数")
    @ColDefine(type = ColType.INT, width = 4)
    @Default("1")
    private Double userChatMsgKeepDayNumber;

    @Column
    @Comment("群聊天记录保留天数")
    @ColDefine(type = ColType.INT, width = 4)
    @Default("30")
    private Double groupLogKeepDayNumber;

    //邮箱相关
    @Column
    @Comment("邮箱地址")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @Default("smtp.ballgold365.com")
    private String emailHost;

    @Column
    @Comment("邮箱端口:win25/centOS465|587")
    @ColDefine(type = ColType.INT, width = 8)
    @Default("3896")
    private Integer emailPort;

    @Column
    @Comment("邮箱用户")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @Default("sys@ballgold365.com")
    private String emailUser;

    @Column
    @Comment("邮箱密码")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @Default("mfi2tyc9")
    private String emailPassword;

    @Column
    @Comment("邮件标题")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @Default("BallGold")
    private String emailTitle;

    @Column
    @Comment("邮件内容，验证码需带上[%s]，例 --> 验证码：[%s]")
    @ColDefine(type = ColType.VARCHAR, width = 128)
    @Default("Verify Code:[%s]")
    private String emailContent;

    //ftp
    @Column
    @Comment("ftp地址")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    private String ftpHost;

    @Column
    @Comment("ftp端口")
    @ColDefine(type = ColType.INT, width = 4)
    @Default("0")
    private Integer ftpPort;

    @Column
    @Comment("ftp用户")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    private String ftpUserName;

    @Column
    @Comment("ftp密码")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    private String ftpPassword;

    @Column
    @Comment("ftp上传文件指定路径")
    @ColDefine(type = ColType.VARCHAR, width = 128)
    private String ftpUploadPath;


    @Column
    @Comment("招募金额")
    @ColDefine(type = ColType.FLOAT, width = 16, precision = 6)
    @Default("100000")
    private BigDecimal recruitAmount;


    @Column
    @Comment("全场波胆赔率公式")
    @ColDefine(type = ColType.VARCHAR, width = 16)
    @Default("50")
    private String fullPdFormula;


    @Column
    @Comment("半场波胆赔率公式")
    @ColDefine(type = ColType.VARCHAR, width = 16)
    @Default("20")
    private String halfPdFormula;


    @Column
    @Comment("全场总入球赔率公式")
    @ColDefine(type = ColType.VARCHAR, width = 16)
    @Default("10")
    private String fullScoreFormula;


    @Column
    @Comment("服务费单位;百")
    @ColDefine(type = ColType.FLOAT, width = 16, precision = 2)
    @Default("5")
    private BigDecimal serviceFee;

    //region erc20

    @Column
    @Comment("ERC20USDT节点地址")
    @ColDefine(type = ColType.VARCHAR, width = 256)
    @Default("http://api-cn.etherscan.com/")
    private String ercUrl;

    @Column
    @Comment("钱包API-KEY")
    @ColDefine(type = ColType.VARCHAR, width = 64)
    @Default("IKK1B5Q5ZPDKVUYE9RUJCBN53RVKZHXXJQ")
    private String ercApiKey;

    //endregion

    //region oneWallet

    @Column
    @Comment("壹钱包充值接口地址")
    @ColDefine(type = ColType.VARCHAR, width = 64)
    @Default("https://api-tg.100scrop.tech/92-d10/SH/sendPay")
    private String oneWalletToPayUrl;

    @Column
    @Comment("壹钱包提现接口地址")
    @ColDefine(type = ColType.VARCHAR, width = 64)
    @Default("https://api-tg.100scrop.tech/92-d10/SH/sendWithdraw")
    private String oneWalletToWithDrawUrl;

    @Column
    @Comment("壹钱包商家安全码")
    @ColDefine(type = ColType.VARCHAR, width = 64)
    @Default("QyCqaNGPgw3hPtASm4eE6g==")
    private String oneWalletSafeCode;

    @Column
    @Comment("壹钱包充值回调地址")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @Default("http://xulh.ngrok.wendal.cn/open/oneWallet/recharge/notify")
    private String oneWalletRechargeNotifyUrl;

    @Column
    @Comment("壹钱包提现回调地址")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @Default("http://xulh.ngrok.wendal.cn/open/oneWallet/withdraw/notify")
    private String oneWalletWithDrawNotifyUrl;

    //endregion

    //region xindovnd

    @Column
    @Comment("鑫都泰国提现接口地址")
    @ColDefine(type = ColType.VARCHAR, width = 64)
    @Default("http://www.xindovnd.com/pay")
    private String xindovndToPayUrl;

    @Column
    @Comment("鑫都泰国提现回调地址")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @Default("http://xulh.ngrok.wendal.cn/open/xindovnd/recharge/notify")
    private String xindovndRechargeNotifyUrl;

    @Column
    @Comment("鑫都泰国提现接口地址")
    @ColDefine(type = ColType.VARCHAR, width = 64)
    @Default("http://www.xindovnd.com/transfer/apply")
    private String xindovndToWithdrawUrl;

    @Column
    @Comment("鑫都泰国提现回调地址")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @Default("http://xulh.ngrok.wendal.cn/open/xindovnd/withdraw/notify")
    private String xindovndWithdrawNotifyUrl;

    @Column
    @Comment("鑫都泰国支付方式")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @Default("promptpay")
    private String xindovndPaytype;

    @Column
    @Comment("鑫都泰国商户号")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @Default("a56d0a95970f4defb43e9faa1630a601")
    private String xindovndMerchant;

    @Column
    @Comment("鑫都泰国商户秘钥")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @Default("e86523fe319c4232a168b13e99984d04")
    private String xindovndSecret;

    //endregion


    //region Elephant

    @Column
    @Comment("大象支付充值地址")
    @ColDefine(type = ColType.VARCHAR, width = 64)
    @Default("https://www.elephant168.com/pay")
    private String elephantToPayUrl;

    @Column
    @Comment("大象支付充值回调地址")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @Default("https://m.ballgold365.com/open/elephant/recharge/notify")
    private String elephantRechargeNotifyUrl;

    @Column
    @Comment("大象支付提现接口地址")
    @ColDefine(type = ColType.VARCHAR, width = 64)
    @Default("https://www.elephant168.com/transfer/apply")
    private String elephantToWithdrawUrl;

    @Column
    @Comment("大象支付提现回调地址")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @Default("https://m.ballgold365.com/open/elephant/withdraw/notify")
    private String elephantWithdrawNotifyUrl;

    @Column
    @Comment("大象支付方式")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @Default("promptpay")
    private String elephantPaytype;

    @Column
    @Comment("大象支付商户号")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @Default("9bcfc15af3d94a3bb41e9e3384a34bf6")
    private String elephantMerchant;

    @Column
    @Comment("大象支付商户秘钥")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @Default("0e33337380884479acaf4c3c02b84515")
    private String elephantSecret;

    //endregion


    //region GlobalPay

    @Column
    @Comment("GlobalPay充值地址")
    @ColDefine(type = ColType.VARCHAR, width = 64)
    @Default("http://zvfdh.yudrsu.com/ty/orderPay")
    private String globalPayToPayUrl;

    @Column
    @Comment("GlobalPay充值回调地址")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @Default("https://m.ballgold365.com/open/globalPay/recharge/notify")
    private String globalPayRechargeNotifyUrl;

    @Column
    @Comment("GlobalPay提现接口地址")
    @ColDefine(type = ColType.VARCHAR, width = 64)
    @Default("http://wrysc.yudrsu.com/withdraw/singleOrder")
    private String globalPayToWithdrawUrl;

    @Column
    @Comment("GlobalPay提现回调地址")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @Default("https://m.ballgold365.com/open/globalPay/withdraw/notify")
    private String globalPayWithdrawNotifyUrl;

    @Column
    @Comment("GlobalPay支付方式")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @Default("ynEbank")
    private String globalPayPaytype;

    @Column
    @Comment("GlobalPay商户号")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @Default("gm761100000067975")
    private String globalPayMerchant;

    @Column
    @Comment("GlobalPay商户秘钥")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @Default("0936D7E86164C2D53C8FF8AD06ED6D09")
    private String globalPaySecret;

    //endregion


    //region crawler
    @Column
    @Comment("爬虫数据服连接地址")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @Default("ws://127.0.0.1:8087/ws")
    private String crawlerAddress;

    @Column
    @Comment("爬虫数据服务明文序号")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @Default("1")
    private String crawlerNo;

    @Column
    @Comment("爬虫数据服务加密密钥")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @Default("rbqA92R8Mmg=")
    private String crawlerSecret;

    //endregion

    @Column
    @Comment("后台只允许白名单中ip的访问")
    @ColDefine(type = ColType.BOOLEAN)
    @Default("0")
    private boolean onlyWhiteList;

}
